package com.afs.electronicforensics.utils;

import android.os.CountDownTimer;
import android.widget.TextView;

import com.afs.electronicforensics.activity.R;

public class TimeCount extends CountDownTimer {

    TextView sendCode;

    public TimeCount(long millisInFuture, long countDownInterval,TextView sendCode) {
        super(millisInFuture, countDownInterval);
        this.sendCode = sendCode;
    }

    @Override
    public void onTick(long l) {
        sendCode.setBackgroundResource(R.drawable.bg_login_submit_lock);
        sendCode.setEnabled(false);
        sendCode.setText( + l/ 1000 + "秒后可重新发送");
    }

    @Override
    public void onFinish() {
        sendCode.setText("重新获取验证码");
        sendCode.setEnabled(true);
        sendCode.setBackgroundResource(R.drawable.bg_login_submit);
    }
}
